package com.tool.btn;

import org.come.Frame.ChatHistoryJframe;
import org.come.until.MessagrFlagUntil;
import org.come.mouslisten.SystemMouslisten;
import javax.swing.ImageIcon;
import org.come.until.FormsManagement;
import come.tool.Fighting.FightingMixDeal;
import java.awt.event.MouseEvent;
import org.come.Jpanel.FrameMessageChangeJpanel;
import org.come.Jpanel.ZhuJpanel;

public class SmallIconBtn extends MoBanBtn
{
    private ZhuJpanel zhuJpanel;
    private FrameMessageChangeJpanel jpanel;
    private String text;
    private int caozuo;
    private int caozuox;

    public SmallIconBtn(final String iconpath, final int type, final int caozuo, final String text, final ZhuJpanel zhuJpanel) {
        super(iconpath, type);
        this.zhuJpanel = zhuJpanel;
        this.text = text;
        this.caozuo = caozuo;
    }

    public SmallIconBtn(final String iconpath, final int type, final int caozuo, final String text, final ZhuJpanel zhuJpanel, final FrameMessageChangeJpanel jpanel) {
        super(iconpath, type);
        this.zhuJpanel = zhuJpanel;
        this.jpanel = jpanel;
        this.text = text;
        this.caozuo = caozuo;
    }

    public SmallIconBtn(final String iconpath, final int type, final int caozuo, final String text, final int num, final ZhuJpanel zhuJpanel) {
        super(iconpath, type);
        this.zhuJpanel = zhuJpanel;
        this.text = text;
        this.caozuo = caozuo;
    }

    @Override
    public void chooseyes() {
    }

    @Override
    public void chooseno() {
    }

    @Override
    public void nochoose(final MouseEvent e) {
        if ("向左".equals(this.text)) {
            FrameMessageChangeJpanel.chatbox.AddAndSubtract(this.caozuo);
        }
        else {
            if ("向上".equals(this.text)) {
                FrameMessageChangeJpanel.chatbox.AddAndSubtract(this.caozuo);
            }
            else {
                if ("向下".equals(this.text)) {
                    FrameMessageChangeJpanel.chatbox.AddAndSubtract(this.caozuo);
                }
                else {
                    if ("向上1".equals(this.text)) {
                        FrameMessageChangeJpanel.chatbox1.AddAndSubtract(this.caozuo);
                    }
                    else {
                        if ("向下1".equals(this.text)) {
                            FrameMessageChangeJpanel.chatbox1.AddAndSubtract(this.caozuo);
                        }
                        else {
                            if ("向上2".equals(this.text)) {
                                FrameMessageChangeJpanel.chatbox2.AddAndSubtract(this.caozuo);
                            }
                            else {
                                if ("向下2".equals(this.text)) {
                                    FrameMessageChangeJpanel.chatbox2.AddAndSubtract(this.caozuo);
                                }
                                else {
                                    if ("清屏1".equals(this.text)) {
                                        FrameMessageChangeJpanel.chatbox1.AddAndSubtract(this.caozuo);
                                    }
                                    else {
                                        if ("清屏2".equals(this.text)) {
                                            FrameMessageChangeJpanel.chatbox2.AddAndSubtract(this.caozuo);
                                        }
                                        else {
                                            if ("星星".equals(this.text)) {
                                                FrameMessageChangeJpanel.chatbox.AddAndSubtract(this.caozuo);
                                            }
                                            else {
                                                if ("加号".equals(this.text)) {
                                                    FrameMessageChangeJpanel.chatbox.AddAndSubtract(this.caozuo);
                                                }
                                                else {
                                                    if ("减号".equals(this.text)) {
                                                        FrameMessageChangeJpanel.chatbox.AddAndSubtract(this.caozuo);
                                                    }
                                                    else {
                                                        if ("添加".equals(this.text) && this.caozuo == 100 && FightingMixDeal.State == 0) {
                                                            this.addFriend();
                                                        }
                                                        else {
                                                            if (!"删除".equals(this.text) || this.caozuo != 100 || FightingMixDeal.State != 0) {
                                                                if (this.text.equals("记录")) {
                                                                    ChatHistoryJframe.getChatHistoryJframe().getChatHistoryJpanel().updateNew();
                                                                    FormsManagement.showForm(708);
                                                                }
                                                                if ("查找".equals(this.text) && this.caozuo == 101 && FightingMixDeal.State == 0) {
                                                                    FormsManagement.showForm(75);
                                                                }
                                                                else {
//                                                                    if ("频道选择".equals(this.text)) {
//                                                                        FormsManagement.showForm(618);
//                                                                    }
//                                                                    else {
                                                                        if ("切换底图".equals(this.text)) {

                                                                            if (FrameMessageChangeJpanel.getSum() < 12) {
                                                                                this.jpanel.lingFan(true);
                                                                                FrameMessageChangeJpanel.setIconH(new ImageIcon("inkImg/old/chat/wxs_" + FrameMessageChangeJpanel.getSum() + ".png"));
                                                                            }
                                                                            if (FrameMessageChangeJpanel.getSum() >= 11) {
                                                                                FrameMessageChangeJpanel.setSum(0);
                                                                                this.jpanel.lingFan(false);
                                                                                FrameMessageChangeJpanel.setIconH(new ImageIcon("inkImg/old/chat/wxs_" + FrameMessageChangeJpanel.getSum() + ".png"));
                                                                            }
                                                                            SystemMouslisten.writeTxt();

                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
//    }

    public void addFriend() {
        MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE4);
    }
}
